package com.hlkj.pay.gateway.merchant;
/*
 * Hlpay-Plus aggregate payment system.
 * Copyright (c) 2024-2025 Hlpay Team Copyright has the right of final interpretation.
 */

import java.util.List;

import com.hlkj.framework.common.pojo.CommonResult;
import com.hlkj.pay.dto.merchant.MerchantAccessDto;
import com.hlkj.pay.dto.merchant.MerchantAuthStatusConfig;
import com.hlkj.pay.dto.merchant.MerchantWechatConfigDto;
import com.hlkj.pay.dto.merchant.access.MerchantAccessResDto;
import com.hlkj.pay.infrastructure.model.merchant.MerchantAccessAuthDO;
import com.hlkj.pay.infrastructure.model.merchant.MerchantAppChannelDO;
import com.hlkj.pay.infrastructure.model.pay.ProviderChannelConfigDO;
import com.hlkj.pay.vo.order.req.MerchantChannelSplitReq;
import com.hlkj.pay.vo.order.req.MerchantProductReq;
import com.hlkj.pay.vo.order.req.MerchantTermAddReq;
import com.hlkj.pay.vo.order.resp.MerchantProductQueryResp;

/**
 * @author HlpayTeam
 * @date 2024/11/07 11:04
 */
public interface IMerchantAccessGateway {

    /**
     * 通道参数校验
     * 
     * @param providerChannelConfig
     * @return
     */
    CommonResult<Void> channelConfigCheck(ProviderChannelConfigDO providerChannelConfig);

    /**
     * 通道实现校验
     * 
     * @param channelCode
     * @return
     */
    boolean extensionExist(String channelCode);

    /**
     * 进件
     * 
     * @param merchantAccessDto
     * @return
     */
    CommonResult<MerchantAccessResDto> merchantAccess(MerchantAccessDto merchantAccessDto);

    /**
     * 进件
     *
     * @param merchantAccessDto
     * @return
     */
    CommonResult<MerchantAccessResDto> processSign(MerchantAccessDto merchantAccessDto);

    /**
     * 签约查询
     * 
     * @param merchantAccessDto
     * @return
     */
    CommonResult<MerchantAccessResDto> processSignQuery(MerchantAccessDto merchantAccessDto);

    /**
     * 进件
     *
     * @param merchantAccessDto
     * @return
     */
    CommonResult<MerchantAccessResDto> merchantBusinessOpen(MerchantAccessDto merchantAccessDto);

    /**
     * 进件
     *
     * @param merchantAccessDto
     * @return
     */
    CommonResult<MerchantAccessResDto> wechatConfigInit(MerchantAccessDto merchantAccessDto);

    /**
     * 进件
     *
     * @param merchantAccessDto
     * @return
     */
    CommonResult<Void> wechatConfigAdd(MerchantAccessDto merchantAccessDto, MerchantAccessAuthDO merchantAccessAuthDO, MerchantWechatConfigDto merchantWechatConfigDto);

    /**
     * 进件
     *
     * @param merchantAccessDto
     * @return
     */
    CommonResult<MerchantAccessResDto> wechatConfigQuery(MerchantAccessDto merchantAccessDto, List<MerchantAccessAuthDO> wechatAccessAuthDbList);

    /**
     * 进件
     *
     * @param merchantAccessDto
     * @return
     */
    CommonResult<MerchantAccessResDto> wechatAuthConfig(MerchantAccessDto merchantAccessDto);

    /**
     * 进件
     *
     * @param merchantAccessDto
     * @return
     */
    CommonResult<MerchantAccessResDto> wechatAuthConfigQuery(MerchantAccessDto merchantAccessDto, List<MerchantAccessAuthDO> wechatAccessAuthDbList);

    /**
     * 通道认证查询是否需要报备信息
     * 
     * @param channelCode
     * @return true 需要报备信息 false 不需要报备信息
     */
    boolean authConfigQueryType(String channelCode);

    /**
     * 进件
     *
     * @param merchantAccessDto
     * @return
     */
    CommonResult<MerchantAccessResDto> aliAuthConfig(MerchantAccessDto merchantAccessDto);

    /**
     * 进件
     *
     * @param merchantAccessDto
     * @return
     */
    CommonResult<MerchantAccessResDto> aliAuthConfigQuery(MerchantAccessDto merchantAccessDto, List<MerchantAccessAuthDO> wechatAccessAuthDbList);

    /**
     * 进件
     *
     * @param merchantAccessDto
     * @return
     */
    CommonResult<MerchantAccessResDto> merchantAccessQuery(MerchantAccessDto merchantAccessDto);

    /**
     *
     * @param merchantAppChannelDO
     * @param merchantTermAddReq
     * @return
     */
    CommonResult<String> termAdd(MerchantAccessDto merchantAccessDto, MerchantAppChannelDO merchantAppChannelDO, MerchantTermAddReq merchantTermAddReq);

    /**
     * 
     * @param merchantAccessDto
     * @return
     */
    CommonResult<MerchantAccessResDto> reloadMerchantAuth(MerchantAccessDto merchantAccessDto);

    /**
     *
     * @param merchantAppChannelDO
     * @param merchantChannelSplitReq
     * @return
     */
    CommonResult<MerchantAccessAuthDO> easySplit(MerchantAccessDto merchantAccessDto, MerchantAppChannelDO merchantAppChannelDO, MerchantChannelSplitReq merchantChannelSplitReq);

    /**
     * 产品变更
     * @param merchantAccessDto
     * @param merchantAppChannelDO
     * @param merchantProductReq
     * @return
     */
    CommonResult<Void> productUpdate(MerchantAccessDto merchantAccessDto, MerchantAppChannelDO merchantAppChannelDO, MerchantProductReq merchantProductReq);

    CommonResult<MerchantProductQueryResp> productQuery(MerchantAccessDto merchantAccessDto, MerchantAppChannelDO merchantAppChannelDO, MerchantProductReq merchantProductReq);

    CommonResult<Integer> queryMerAuthStatus(MerchantAccessDto merchantAccessDto,MerchantAuthStatusConfig merchantAuthStatusConfig);
}
